-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate HTML output and send it to Slack, make output files downloadable in the web UI #3
Conversation
Summary:
Notes:
|
Testing checklist:
import datetime
datetime.datetime.now() |
So how will this be configured? i.e. "send to slack" is not a feature that all nebari / jupyter-scheduler users will need. Also someone else might want to send it to mattermost or another rest api. Is there a way to make this a bit more generic. |
Currently, it'll only execute this task if you provide
Technically, we can turn this into "specify a random shell command and I'll execute it", but I don't think it's a good design.
I'd suggest we add support for additional APIs separately, on a case by case basis. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@nkaretnikov lets add docs also I think we need to make sure runs are timestamped. Are they also saved to disk as well as sent to slack? "send to slack" needs to be optional. |
- These files correspond to "Output formats" on the "Create Job" page and have timestamps matching `job.create_time` - jupyter-scheduler looks for these when you download files via "Output files" on the "Notebook Jobs" page, download fails otherwise - See `create_output_filename` and `get_staging_paths` in jupyter-scheduler.
The actual value can also be 1969-12-31-06-00-00-PM, so remove the exact date to avoid confusion.
Manually tested everything as of this commit (3a42dd0):
|
@aktech I've tested and reviewed this. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nkaretnikov
Thanks for taking another pass at this, I am having hard time understanding the flow and reasoning for various things here even after reading some of the notes you have, maybe because it's scattered here and there and probably because of my lack of understanding of argo workflows. I see you have added usage documentation, can you please add a short working comment explaining step by step what's happening here architecturally, like e.g.:
- We schedule a job from papermill with parameters x, y
- Then we create a job for running the given notebook via Argo workflows...
- Then we rename files because of reason m, n, o, etc... and that's the most apt way because of reason j, k, l
- ....
We can then put this doc in the code itself as well, since not everyone contributing would be very familiar with Argo workflows.
argo_jupyter_scheduler/executor.py
Outdated
|
||
try: | ||
# Sets up logging | ||
logger = setup_logger("rename_files") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shadows name logger
from outer scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that's on purpose. I've just re-tested to be sure, too. The global logger
name is not accessible here. Things used in these script
s need to be local to them because they'll be running as separate pods. That's why they have these local imports. And you also cannot pass arbitrary Python objects as parameters - only very basic serializable things, like strings and dicts.
argo_jupyter_scheduler/executor.py
Outdated
|
||
except Exception as e: | ||
msg = "Failed to rename files" | ||
logger.info(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use logger.exception
log full traceback.
argo_jupyter_scheduler/executor.py
Outdated
try: | ||
# Sets up logging | ||
logger = setup_logger("rename_files") | ||
add_file_logger(logger, log_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do these two lines are inside try
block?
If there is an exception here then you'd not have the logger
variable in the except block anyway.
) | ||
|
||
failure += " || {{steps.rename-files.status}} == Failed" | ||
successful += " && {{steps.rename-files.status}} == Succeeded" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The start_time value needs to be generated within that step. But we cannot pass the start_time value directly between these steps. Instead, we use the database.
What do you mean by generated? Isn't start_time
the time of start of the job and not some thing that's generated?
@aktech PTAL. Made the changes you suggested, added more info to the internals section of README. Tested to make sure it's working and the backtraces are logged to a file. |
I went ahead and merged this since it'd be nice to have as part of the current Nebari release, see nebari-dev/nebari#2195 (comment). |
Reference Issues or PRs
What does this implement/fix?
Put a
x
in the boxes that applyTesting
Documentation
Access-centered content checklist
Text styling
H1
or#
in markdown).Non-text content
Any other comments?